package com.aurora.app.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.aurora.app.enums.DepositState;
import com.aurora.app.enums.FalseChoose;
import com.aurora.base.entity.BaseEntity;

@Entity
@Table(name="tb_deposit")
public class Deposit extends BaseEntity {
	private Thing userThing;
	private PayOrder pay;
	private Date continueTime;
	private String qtCode;
	private Volunteer volunteer;
	private Date startTime;
	private Date toStationTime;
	private FalseChoose falseChoose;
	private DepositState depositState;
	
	@ManyToOne(cascade = {CascadeType.REFRESH}, optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name = "f_user_thing_id")
	public Thing getUserThing() {
		return userThing;
	}
	public void setUserThing(Thing userThing) {
		this.userThing = userThing;
	}
	@Column(name="f_pay_id")
	public PayOrder getPay() {
		return pay;
	}
	public void setPay(PayOrder pay) {
		this.pay = pay;
	}
	@Column(name="f_deposit_continue_time")
	public Date getContinueTime() {
		return continueTime;
	}
	public void setContinueTime(Date continueTime) {
		this.continueTime = continueTime;
	}
	@Column(name="f_deposit_qtCode")
	public String getQtCode() {
		return qtCode;
	}
	public void setQtCode(String qtCode) {
		this.qtCode = qtCode;
	}
	@ManyToOne(cascade = {CascadeType.REFRESH}, optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name = "f_volunteer_id")
	public Volunteer getVolunteer() {
		return volunteer;
	}
	public void setVolunteer(Volunteer volunteer) {
		this.volunteer = volunteer;
	}
	@Column(name="f_start_time")
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	@Column(name="f_to_station_time")
	public Date getToStationTime() {
		return toStationTime;
	}
	public void setToStationTime(Date toStationTime) {
		this.toStationTime = toStationTime;
	}
	@Enumerated(EnumType.ORDINAL)
	@Column(name = "f_false_choose")
	public FalseChoose getFalseChoose() {
		return falseChoose;
	}
	public void setFalseChoose(FalseChoose falseChoose) {
		this.falseChoose = falseChoose;
	}
	
	@Enumerated(EnumType.ORDINAL)
	@Column(name = "f_state")
	public DepositState getDepositState() {
		return depositState;
	}
	public void setDepositState(DepositState depositState) {
		this.depositState = depositState;
	}
	
}
